package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @Author Justin Parker
 * @Date 2024/8/3 0003 9:47
 * @Version 1.0
 */
@Component
public class ShopController {

    public String hdsad;

    public ShopController() {
        System.out.println("1.无参构造");
    }
    @Value("2.set方法赋值")
    public void setHdsad(String hdsad) {
        this.hdsad = hdsad;
        System.out.println("2.set方法赋值");
    }
    @PostConstruct
    public void init(){
        System.out.println("3.初始化方法");
    }

    @PreDestroy
    public void destroy(){
        System.out.println("5.销毁方法");
    }
}
